import { ref, computed } from 'vue'
import { defineStore } from 'pinia'

export const useStore = defineStore('zhihuDaily', () => {

  const top_stories = ref([])
  const setTopStories = (data) => {
    top_stories.value = data
  }


  const recentStories = ref([])
  const setRecentStories = (data) => {
    recentStories.value = data
  }


  const stories = ref([])
  const setStories = (data) => {
    stories.value = data
  }


  const date = ref('')
  const setDate = (data) => {
    date.value = data
  }

  const dates = ref([])
  const setDates = (data) => {
    dates.value = data
  }

  const author = ref('')

  const setAuthor = (data) => {
    author.value = data
  }


  return { top_stories, setTopStories, recentStories, setRecentStories, stories, setStories, date, setDate, dates, setDates, author, setAuthor }
}, {
  persist: true,
})
